package vip.xiaonuo.bi.modular.dataset.dispatcher;

import org.springframework.beans.factory.annotation.Autowired;
import vip.xiaonuo.bi.core.datasource.util.IdUtils;
import vip.xiaonuo.bi.modular.dataset.param.DataSetSqlTypeParam;
import vip.xiaonuo.bi.modular.dataset.param.DataSetTypeParam;
import vip.xiaonuo.bi.modular.dataset.param.DatasetInfo;
import vip.xiaonuo.bi.modular.datasource.doris.DorisTbService;

import java.util.List;

/**
 * @auther: 顾育司
 * @Description
 * @date: 2024/1/13
 */
public abstract class DataSetClient {


    @Autowired
    DorisTbService dorisTbService;

    public String getDorisTable(){
        return IdUtils.getRandomID(getDataSetType());
    }

    public String setdorisTable(DataSetTypeParam dataSetTypeParam){
        DataSetSqlTypeParam dataSetSqlTypeParam = (DataSetSqlTypeParam) dataSetTypeParam;
        String dorisTable = IdUtils.getRandomID(getDataSetType());
        dataSetSqlTypeParam.setTable(dorisTable);
        return dorisTable;
    }

    /**
     * 获取数据集类型
     * @return
     */
   public abstract String getDataSetType();

    /**
     * 获取实际要存储的数据
     * @param dataSetTypeParam
     * @return
     */
    public abstract List<List<String>> getData(DataSetTypeParam dataSetTypeParam);

    /**
     * 获取数据统计信息
     * @param dataSetTypeParam
     * @return
     */
    public abstract DatasetInfo getCount(DataSetTypeParam dataSetTypeParam);
}
